# To change this template, choose Tools | Templates
# and open the template in the editor.

__author__="furoscame"
__date__ ="29.12.11 23:29"

class LeoModule(object):
    """Here are the level and book informations"""
    def __init__(self):
        # base
        ta = (0x00, ('sec', '1')), (0x01, ('sec', '2')), (0x02, ('sec','5')), (0x03, ('sec','15')), (0x4, ('sec', '30')), (0x5, ( 'sec','60')), (0x6, ('sec','120')), (0x7, ('sec','180'))
        tb = (0x10, ('tour', (('30', '30', '0'), ('30', '30', '0')))), (0x11, ('tour',(('40', '120', '0'), ('20', '60', '0')))), (0x12, ('tour', (('40', '150', '0'), ('16', '60', '0')))), (0x13, ('tour', (('45', '90', '0'), ('15', '30', '0')))), (0x14, ('tour', (('0', '50', '150'), ('0', '20', '60')))), (0x15, ('sec', '10')), (0x16, ('infinite',0)), (0x17, ('mate', 0))
        tc = (0x20, ('tour', (('0', '5', '0'), ()))), (0x21, ('tour', (('0', '10', '0'), ()))), (0x22, ('tour', (('0', '15', '0'), ()))), (0x23, ('tour', (('0', '20', '0'), ()))), (0x24, ('tour', (('0', '30', '0'), ()))), (0x25, ('tour', (('0', '60', '0'), ()))), (0x26, ('tour', (('0', '90', '0'), ()))), (0x27, ('tour', (('0', '120', '0'), ())))
        td = (0x30, ('ply', '1')), (0x31, ('ply', '2')), (0x32, ('ply', '3')), (0x33, ('ply', '4')), (0x34, ('ply', '5')), (0x35, ('ply', '6')), (0x36, ('ply', '7')), (0x37, ('ply', '8'))

        # analyst
        te = (0x40, ('sec', '5')), (0x41, ('sec', '15')), (0x42, ('sec', '30')), (0x43, ('sec', '60')), (0x44, ('sec', '120')), (0x45, ('sec', '180')), (0x46, ('sec', '360')), (0x47, ('ply', 1))
        tf = (0x50, ('tour', (('30', '30', '0'), ('30', '30', '0')))), (0x51, ('tour', (('35', '90','0'), ('0', '15', '0')))), (0x52, ('tour', (('40', '120', '0'), ('20', '60', '0')))), (0x53, ('tour', (('45', '120', '0'), ('23', '60', '0')))), (0x54, ('tour', (('50', '150', '0'), ('20', '60', '0')))), (0x55, ('tour', (('60', '60', '0'), ('30', '30', '0')))), (0x56, ('tour', (('40', '150', '0'), ('16', '60', '0')))), (0x57, 'infinite')
        tg = (0x60, ('tour', (('0', '5', '0'), ()))), (0x61, ('tour', (('0', '7', '0'), ()))), (0x62, ('tour', (('0', '10', '0'), ()))), (0x63, ('tour', (('0', '15', '0'), ()))), (0x64, ('tour', (('0', '30', '0'), ()))), (0x65, ('tour', (('0', '45', '0'), ()))), (0x66, ('tour', (('0', '60', '0'), ()))), (0x67, ('tour', (('0', '90', '0'), ())))
        # someday i define my own levels :-)
        th = (0x70, ('sec', '1')), (0x71, ('sec', '2')), (0x72, ('sec', '5')), (0x73, ('sec', '15')), (0x74, ('sec', '30')), (0x75, ('sec', '60')), (0x76, ('sec', '120')), (0x77, ('sec', '180'))
        self.level = ta + tb + tc + td + te + tf + tg + th
        
        pass
    pass

    def set_base(self):

        pass

    def set_module(self):
        pass

    def get_level(self, leo_level):
        #i = 0
        for l in self.level:
            #print l
            ret = l[0]
            if l[0] == leo_level:
                #print "leomodule level", l[1]
                return l[1]
            #i += 1
            pass

        return ret
        pass
    pass

    def leo_level_to_uci_(self, leo_level):
        uci_level = ('a1',1)
        #find in self.level
        return uci_level

        pass
    pass
pass

